package com.meilai.project.controller.web.business.workbench;

import com.meilai.project.dto.CommonResult;
import com.meilai.project.service.business.workbench.YearWeekService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 年度月份表 前端控制器
 * </p>
 *
 * @author haiYangXu
 * @since 2022-08-16
 */
@RestController
@RequestMapping("/api/web/yearWeek")
public class YearWeekController {

    @Autowired
    private YearWeekService service;

    @GetMapping("/list")
    @ApiOperation("根据客户获取周期列表")
    public CommonResult list(@RequestParam("customer_id") Long customer_id, @RequestParam(value = "record_id", required = false) Long record_id) {
        return new CommonResult().success(service.selectList(customer_id, record_id));
    }
}
